UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Uz1a8retcrpDcyhSzJByJE4eHzlxiClnMsAj01BNENk='
WHERE
key_id = 'd4184ad36a0153769211b2e7d3fe61c14ef228ada7d8a8be15090bf3a8e7acfa'
AND (
token = 'Uz1a8retcrpDcyhSzJByJE4eHzlxiClnMsAj01BNENk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)