UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gOZ/s8qxxJ4mVRc0hWLbuox0Si7xlsry4dcM4X3EElQ='
WHERE
key_id = '36a47fb2510966e4d897734f4e653c68b4255ade01841ce276b348c1851ffb38'
AND (
token = 'gOZ/s8qxxJ4mVRc0hWLbuox0Si7xlsry4dcM4X3EElQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)