UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3oKp2j0sedQvd/kU5x036g1e/iOFGk8iq1/Uj6+vq0U='
WHERE
key_id = 'edccf9a7528824080d6f550ab3687a2f31db12171e1623f0f91a3b776798e5b7'
AND (
token = '3oKp2j0sedQvd/kU5x036g1e/iOFGk8iq1/Uj6+vq0U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)