UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'v5JK6nKhB4sGewe7drOAv7RcHMSOu1u3DFXm7nfi/68='
WHERE
key_id = 'c182aac7e7d43824edfafa9dafd3f23fccf0f9aa14082709666cd030abdc4767'
AND (
token = 'v5JK6nKhB4sGewe7drOAv7RcHMSOu1u3DFXm7nfi/68='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)