UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+S1ttFf0VmxOuX3BiA1lNoamYIXwNuen9Zk7AhKe7Pg='
WHERE
key_id = '913c6d6ec5ccfd94ad03c73f72086489eeeee1ecdd989b68fea8062cabef59dd'
AND (
token = '+S1ttFf0VmxOuX3BiA1lNoamYIXwNuen9Zk7AhKe7Pg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)