UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YlIErItoXacJaTB4TX/BIWW0Q6hIWIp92qb/7Bmu3hk=' 
WHERE 
  key_id = '6de7af78381c407622a45f03281c7cb6e69ac0a2241a32c4f8fdb261503dfac0' 
  AND (
    token = 'YlIErItoXacJaTB4TX/BIWW0Q6hIWIp92qb/7Bmu3hk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016