UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LfP7r9Rxgtm+Bjr85RbXeL6VaSyHZI8VQPnJgMH9Uy0=' 
WHERE 
  key_id = '8bf9555bc8539b775a1de7433603958cc0f6916662c64f4baf9d5130e477ddca' 
  AND (
    token = 'LfP7r9Rxgtm+Bjr85RbXeL6VaSyHZI8VQPnJgMH9Uy0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018