UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OPPsT0PcahVmlPkt0Eyuj6yNcRYshKcddd7n0ASMnaE=' 
WHERE 
  key_id = '70b0d9e4071c42fe35f1847884e721b39981f34d2c024398d0f4b3685c08c075' 
  AND (
    token = 'OPPsT0PcahVmlPkt0Eyuj6yNcRYshKcddd7n0ASMnaE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019