UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4vRV0h92p4rwDBD5/3biAq+DjjxCSz7yj3Ucio5FVWE=' 
WHERE 
  key_id = '9e6a7a1d419cf5a26e300c837923788046b8cb5b99c758bc6a9bded7cdf9d96f' 
  AND (
    token = '4vRV0h92p4rwDBD5/3biAq+DjjxCSz7yj3Ucio5FVWE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029