UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ByxBRNKjN1hW+Ew6fWvSnYBzzvBuJR21+CiDTPg5izo=' 
WHERE 
  key_id = '1cb271128e36dd760ee4836326c8fae0cbe70484e1aed3a50e4be71f5453d486' 
  AND (
    token = 'ByxBRNKjN1hW+Ew6fWvSnYBzzvBuJR21+CiDTPg5izo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034