UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'icdC8KX8z1p+PwlttWBH7wfuYy3etKp0ZOMmHyLGHeg=' 
WHERE 
  key_id = '9fa99396e0207fd856674066493da74acf0259cabd539bace9bc7d71297c7c7c' 
  AND (
    token = 'icdC8KX8z1p+PwlttWBH7wfuYy3etKp0ZOMmHyLGHeg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031