UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Yfzf18Pt9EsiU+AAuPTdDFq2mNsYw/VsUuwuIev9YMQ='
WHERE
key_id = '2e0e8586c0cdf290c2a63945952a7def2f4ee09951ede4c47ba715a9ee3d91ed'
AND (
token = 'Yfzf18Pt9EsiU+AAuPTdDFq2mNsYw/VsUuwuIev9YMQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)