UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5sgv+yxzYpG/+bCdX7sLl9BwuNdffYziNKqRJXOXEkc='
WHERE
key_id = 'd86ec611d0221db870383fc2e01eb7574f65d984fa5d31b8c9e742c1396d2375'
AND (
token = '5sgv+yxzYpG/+bCdX7sLl9BwuNdffYziNKqRJXOXEkc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)