UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ljfI30T93E7JgzCV0SBihHCrqNO3zSryc1H5t0n/pcE=' 
WHERE 
  key_id = '4896ce9f8bf4809edfa65ad2ee504218bb324ac0128b2c44cd3d242d7e587359' 
  AND (
    token = 'ljfI30T93E7JgzCV0SBihHCrqNO3zSryc1H5t0n/pcE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015