UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cVI0Yul/2Vh/m1Ss7qDfaBAdu3nKQ2pZLyfgI3qAt6c='
WHERE
key_id = 'ef7fbd114ffa271db27c0b8ad2704fed516bf67b5ec475ab7389aa9f0d4c84f2'
AND (
token = 'cVI0Yul/2Vh/m1Ss7qDfaBAdu3nKQ2pZLyfgI3qAt6c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)