UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4rZuxqY0liloedcLPT/F3jPNXuLF20MnLu0Ehjt5R0g='
WHERE
key_id = 'ad3d82fbc22f0deb09e831f2cd1aba49b32b2b05c59881e8288d19d2591a39dc'
AND (
token = '4rZuxqY0liloedcLPT/F3jPNXuLF20MnLu0Ehjt5R0g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)