UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oIbLF48+C57OIMU6BMwE477eNan0a0CoTc/Rum33Z9s=' 
WHERE 
  key_id = '620c34a65b255484dc5eb963e4288490bce1fa1ffe8470302ea869d100e22a94' 
  AND (
    token = 'oIbLF48+C57OIMU6BMwE477eNan0a0CoTc/Rum33Z9s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043