UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RANv2KB5Iatl+Ve1JyJMfnpjVHFPWNYyPNf32Hjnl3w=' 
WHERE 
  key_id = '4ac05875e28e496031438ba3f78d0d2f76b59b15aa70bd236a8c666f9ba05b83' 
  AND (
    token = 'RANv2KB5Iatl+Ve1JyJMfnpjVHFPWNYyPNf32Hjnl3w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029