UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Awj5EOygifRtcIPI+ojrwYVmKSbGrWu9Q+6CXrIlyXI='
WHERE
key_id = '45b94474c76fab9f5baeabe260f3b3b794ec1d1727f6cf3713295cabf336f2a3'
AND (
token = 'Awj5EOygifRtcIPI+ojrwYVmKSbGrWu9Q+6CXrIlyXI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)