UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2DlL1RCoe6FLu9YBbV34tDqPb4e9WB7xJ8S1MXy3WTo='
WHERE
key_id = '9f01fd6de4eeeb37662e6ce1ad06a5a962f693366c9638a8b0c1a9023bbe994a'
AND (
token = '2DlL1RCoe6FLu9YBbV34tDqPb4e9WB7xJ8S1MXy3WTo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)