UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'J/XWz72gkjYsXOvgLz13exQCHW7+cDWeRj5sOA8rYlM='
WHERE
key_id = 'e7733c5cdbd4b7b3d0bfadb90f6152c4e8a63a9be11ce337c4891c902d3a6751'
AND (
token = 'J/XWz72gkjYsXOvgLz13exQCHW7+cDWeRj5sOA8rYlM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)