UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Cls4tI4Z+yq8sBfBRCvvOCwM2x7CrAZvzmrgn+kslVs=' 
WHERE 
  key_id = '2d645c7ee88237d4b23fa8537dfe825b6a66bacbbcad782bd4a139e44b10f870' 
  AND (
    token = 'Cls4tI4Z+yq8sBfBRCvvOCwM2x7CrAZvzmrgn+kslVs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035