UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gnDCbSDKDRXZL0dVQqFnjAu8vk+XF7p+XfzoPYWH4sQ='
WHERE
key_id = '8f249c2acb3f2536b3ac20b644ca2aea9fe0cc18bde403e585cd3e671bac0dfd'
AND (
token = 'gnDCbSDKDRXZL0dVQqFnjAu8vk+XF7p+XfzoPYWH4sQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)