UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tEiXwPHt5yELN4J3+mVe5r3uSCMyVqsBbMaHO5CdiEM='
WHERE
key_id = 'eb29cf8532f91a3ac7ce854f3c1e82c664e5a34d15dd2bcaf6014037374ed0ff'
AND (
token = 'tEiXwPHt5yELN4J3+mVe5r3uSCMyVqsBbMaHO5CdiEM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)