UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+2w84n5SuUW697nwMJnG2+EQUuvNYQ7xrlmgh/R32No='
WHERE
key_id = 'a8fb9fcea74535580d536e3484bb8addb96abc2c225b75e15fe24a30a8587f6e'
AND (
token = '+2w84n5SuUW697nwMJnG2+EQUuvNYQ7xrlmgh/R32No='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)