UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1xP7daBZ1+JV4Bs8kTSlnZXRjvi/WEH5KJl/GOpzlIk='
WHERE
key_id = 'e45924e068c650361ce0d81779fc0f7f564895a2502b3a9252a1cf540a8b872a'
AND (
token = '1xP7daBZ1+JV4Bs8kTSlnZXRjvi/WEH5KJl/GOpzlIk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)