UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mEjKpTMKgowGDI/8ePo6o2H9CHN8cgNq9L77LMD60Nk='
WHERE
key_id = '0c25a4d52f41d732805dad1d81e0be954b560f5181e354363a9ae264feb413a8'
AND (
token = 'mEjKpTMKgowGDI/8ePo6o2H9CHN8cgNq9L77LMD60Nk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)