UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'iUfTxvS8+fPN/No/uM0ZUtBrQgB2ds1YgG1VJGyFMlk=' 
WHERE 
  key_id = '962e544065ecc17e063be4614dcfc128ef7f64c7c0468689cc74960f98d6375f' 
  AND (
    token = 'iUfTxvS8+fPN/No/uM0ZUtBrQgB2ds1YgG1VJGyFMlk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041