UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EeUagxB8dVl6W3PxKOGOizgH2tqatufHRJc+c2uLMb0='
WHERE
key_id = '659c73ae0f79f5c8e69bb07c3a853e64285ce425f1e21642cb13f8c13cda42f8'
AND (
token = 'EeUagxB8dVl6W3PxKOGOizgH2tqatufHRJc+c2uLMb0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)