UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eEdwVJS8gwaKU7/KBp9vqqJpoVGgjTX4ukfTC5AHpmQ=' 
WHERE 
  key_id = 'a056be8ce09ab83aea518f7b427bf11e6ee6d9e37f0f3b946657338518e62fbc' 
  AND (
    token = 'eEdwVJS8gwaKU7/KBp9vqqJpoVGgjTX4ukfTC5AHpmQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036