UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2PvZUzBMrS8LwOTf43xsMdzN2jdab0+/Po7j1h6cpPE=' 
WHERE 
  key_id = 'bb95414574442cb9abe2744d267dabfa84f64375f367088371a274d1e27545d6' 
  AND (
    token = '2PvZUzBMrS8LwOTf43xsMdzN2jdab0+/Po7j1h6cpPE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027