UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8qe/p/BUe+GTfUaDqlpdVDSu+KnZGBQTPP4NuLwX9AA='
WHERE
key_id = '6113eba90dd6b23642fb1e1d146a17d2318238cdde5640d8d5ae7da8a7ba84dc'
AND (
token = '8qe/p/BUe+GTfUaDqlpdVDSu+KnZGBQTPP4NuLwX9AA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)