UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jd/ZM7BDapL3h6t3wT5aPzINK6/69wgCLHnFvyGFRfM='
WHERE
key_id = 'a63ca1099db2fbc2ea9d14ef81ca06d3d9b0f2fdb6c5513952ac1bb14f4b3c79'
AND (
token = 'jd/ZM7BDapL3h6t3wT5aPzINK6/69wgCLHnFvyGFRfM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)