UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8DXaA7JPVPdnWYvDglG0K1QkLq5+5Jjyz40XjaBgNC0='
WHERE
key_id = 'eb7c60e106c7f5f036c6f2a295c67d34ad08b1da28d01d95060d754bb77995a3'
AND (
token = '8DXaA7JPVPdnWYvDglG0K1QkLq5+5Jjyz40XjaBgNC0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)