UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2z8GH1Ioh6osBWtD+mHnowt9BIGtV6camT0t7vWi4/U='
WHERE
key_id = 'c250e6e272018619ef6fb9dbf42b2badba506c59a45d89f75c618e11534d1e1a'
AND (
token = '2z8GH1Ioh6osBWtD+mHnowt9BIGtV6camT0t7vWi4/U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)