UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'N8yTHmR6qsZTDNffgbAQ0mYmvxp/GxMSe9alrB8AwsQ='
WHERE
key_id = '703f0926ee0b34b5365f127d4023cd0fdd7dab7f98173b72303c63a6ff90e458'
AND (
token = 'N8yTHmR6qsZTDNffgbAQ0mYmvxp/GxMSe9alrB8AwsQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)