UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yrJHTPTE0yBSDF8lYxtKdUCr46i9/jItLODQOjgB86A='
WHERE
key_id = '1d4d664414592e1dfd750f3f6f31581ef9acc97524cf376e49ba9f10e48c2cd6'
AND (
token = 'yrJHTPTE0yBSDF8lYxtKdUCr46i9/jItLODQOjgB86A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)