UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NuAwoTmSVHHNuIxL2HxuMfX/omo7XnLyToaskpjCtzg='
WHERE
key_id = 'e5588ac74bd8ee92f8372fb978963a84107a8e2e2bddfdc4d64bd22abcd324d1'
AND (
token = 'NuAwoTmSVHHNuIxL2HxuMfX/omo7XnLyToaskpjCtzg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)