UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rOxXJUUu52V4ctfdQlM1d3u61OosFiQWkjyueZRef/4=' 
WHERE 
  key_id = 'bf593c8f99e003ef1e2c769ddc418a8c1ec61f814d28fcd0c3cc65a32c3bdb73' 
  AND (
    token = 'rOxXJUUu52V4ctfdQlM1d3u61OosFiQWkjyueZRef/4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024