UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ai7vwbP3mTLEYgJSfEEzBpl+dIXnARpLc20oeQKfvQM='
WHERE
key_id = '1aa34feae3886ac6898a864089337bbff946c464ab06f703269f51041350aebf'
AND (
token = 'ai7vwbP3mTLEYgJSfEEzBpl+dIXnARpLc20oeQKfvQM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)