UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dIf+RpsdyhyS17gmu3kNJVGsaUCPHimBLwBG8HwtSIk='
WHERE
key_id = '6ecbb6936c911717bb56bc656bb2df639d3e6c0524ac7b4ab147f7c76bc3075f'
AND (
token = 'dIf+RpsdyhyS17gmu3kNJVGsaUCPHimBLwBG8HwtSIk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)