UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cE3gXrLI7ryIRvHD4Ciwl6494/35yThC2wvqcbfrGdk='
WHERE
key_id = '89958c940213f7103e08e61ad14d3bf4e0073b8dca611d1e54b08f8ebb5faa8e'
AND (
token = 'cE3gXrLI7ryIRvHD4Ciwl6494/35yThC2wvqcbfrGdk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)