UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'V/7Rk3c6/XY7JAakG1Bfq/o3jEgFsao9xpl6ck7dxR4='
WHERE
key_id = 'dea3aabb69b0bf5182349a7eee87f42c0a043ffa20a837a3f7c6eeba63353145'
AND (
token = 'V/7Rk3c6/XY7JAakG1Bfq/o3jEgFsao9xpl6ck7dxR4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)