UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'W2aobSRZi3UxpztdaAYygS/X7Z71dMw1LLHPEt7ntHs='
WHERE
key_id = '0dcf8cbfa5d5cfbc2bc29fe3599727b168ab3e8db1a9999ea0c1ed56fe860577'
AND (
token = 'W2aobSRZi3UxpztdaAYygS/X7Z71dMw1LLHPEt7ntHs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)