UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'iyN7VQr14RdO+I3L9s7S6iMABTyQVwJINtqkNFxY01w=' 
WHERE 
  key_id = 'cfcb64fd56421937b1ef29d9178896ef957025633d8285da96eb7b4a87497014' 
  AND (
    token = 'iyN7VQr14RdO+I3L9s7S6iMABTyQVwJINtqkNFxY01w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035