UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JP1S7KJyueSwQiHPjAXcjgnixji5Ihxt2Y16nCV1fkQ='
WHERE
key_id = '848ba2fee87bb0af36707c475ad964ef0deb10f7da8fa23b2396e22ec19333f6'
AND (
token = 'JP1S7KJyueSwQiHPjAXcjgnixji5Ihxt2Y16nCV1fkQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)