UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4UNKabP3WhFT/iSKnMsHQ1kQJipGD3kYUXaCIWtbxAw='
WHERE
key_id = 'c0f7c6134744b5c4853e0ec7e88f81aef81e52b7323a8c60f729a462974285c4'
AND (
token = '4UNKabP3WhFT/iSKnMsHQ1kQJipGD3kYUXaCIWtbxAw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)