UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'epV+9jfTD1PEhW6gECXtRKCimi5O7CSGc5JoRzOZcHY='
WHERE
key_id = '060baf368e5b5e368f6a0b67496314824e570cf96c52bec46b1c92406b48e80c'
AND (
token = 'epV+9jfTD1PEhW6gECXtRKCimi5O7CSGc5JoRzOZcHY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)