UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MneSUd6EdWk4yJH69j1qcgTMN1GpqFFE+pomQ0MzAS4=' 
WHERE 
  key_id = 'd053f6db40d400a9a04c4aa8e21fba6c5ca7e27c08dd37125f33d23fdbe02bfc' 
  AND (
    token = 'MneSUd6EdWk4yJH69j1qcgTMN1GpqFFE+pomQ0MzAS4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021